package com.dzm.xgb.gateway.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.cors.CorsConfiguration;
import org.springframework.web.cors.reactive.CorsConfigurationSource;
import org.springframework.web.cors.reactive.CorsWebFilter;
import org.springframework.web.cors.reactive.UrlBasedCorsConfigurationSource;

/**
 * 作者：Dzm
 * 时间：2024-09-04-10:14
 * 功能：
 */

//@Configuration
//public class XgbCrosConfig {
//
//    @Bean
//    public CorsWebFilter corsWebFilter() {
//        UrlBasedCorsConfigurationSource config = new UrlBasedCorsConfigurationSource();
//        CorsConfiguration crosConfig = new CorsConfiguration();
//        crosConfig.addAllowedOrigin("*");
//        crosConfig.addAllowedMethod("*");
//        crosConfig.addAllowedHeader("*");
//        config.registerCorsConfiguration("/**", crosConfig);
//        CorsWebFilter corsWebFilter = new CorsWebFilter(config);
//        return corsWebFilter;
//    }
//}
